#include "ShapePacker.h"



void ShapePacker::packToShapeSet(ShapeSet *sets, QVector<Shape> &vec)
{
    for (auto it = vec.begin(); it != vec.end(); ++ it)
    {
        sets->add_shapes((*it).SerializeAsString());
    }
}

void ShapePacker::depackFromShapeSet(ShapeSet *sets, QVector<Shape> &vec)
{
    for (int i = 0; i < sets->shapes_size(); i ++)
    {
        Shape sp;
        sp.ParseFromString(sets->shapes(i));
        vec.append(sp);
    }
}
